The parathyroid glands originate from the interaction of the endoderm of the third and fourth pouch and neural crest mesenchyme.
The pair of glands which is ultimately inferior develops from the third pouch with the thymus, whereas the pair of glands which is ultimately superior develops from the fourth pouch.
During embryological development, the thymus migrates downwards, dragging the inferior glands with it. The superior pair are not dragged downwards by the fourth pouch to the same degree. The glands are named after their final, not embryological, positions.[9]
Since the thymus's ultimate destination is in the mediastinum of the chest, it is occasionally possible to have ectopic parathyroids derived from the third pouch within the chest cavity if they fail to detach in the neck.
Parathyroid development is regulated by a number of genes, including those coding for several transcription factors.[10][a]
Reference
See: https://embryology.med.unsw.edu.au/embryology/index.php/Endocrine_-_Parathyroid_Development